#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;
uniform float u_time;

void main(){
    vec2 st=gl_FragCoord.xy/u_resolution;
    
    float r = 5.0 - mod(u_time,.8)*10.0/.1;
    float dist=smoothstep(.8,.1,mod(u_time,.8));
    if(dist == 1.0){
        if(r > 0.0){
        dist = 0.0;
        }
    }
    
    gl_FragColor=vec4(1.,0.,0.,dist);
}